class UserLoginModel {
  final String userCode;
  final String plainUserPwd;
  final String? captcha; // Optional field

  UserLoginModel({
    required this.userCode,
    required this.plainUserPwd,
    this.captcha, // Optional in constructor
  });

  // Convert to JSON for API request
  Map<String, dynamic> toJson() => {
        'userCode': userCode,
        'plainUserPwd': plainUserPwd,
        // if (captcha != null) 'captcha': captcha, // Only include if not null
        'captcha': captcha,
      };

  // For debugging
  @override
  String toString() {
    return 'UserLoginDTO{userCode: $userCode, plainUserPwd: ***, captcha: ${captcha ?? 'not set'}}';
  }
}
